home *** CD-ROM | disk | FTP | other *** search
- Path: library.erc.clarkson.edu!rpi!not-for-mail
- From: davidb@datalytics.com (David Bradley)
- Newsgroups: comp.lang.c++,comp.lang.c++.moderated
- Subject: Re: Argc & Argv
- Date: 28 Feb 1996 15:00:25 -0000
- Organization: Datalytics Inc.
- Sender: cppmods@netlab.cs.rpi.edu
- Approved: Dietmar.Kuehl@uni-konstanz.de
- Message-ID: <4h1qm9$8h2@netlab.cs.rpi.edu>
- References: <4gta9f$df5@netlab.cs.rpi.edu>
- NNTP-Posting-Host: netlab.cs.rpi.edu
- X-Original-Date: Tue, 27 Feb 1996 19:09:31 GMT
-
- Rick Richert <richert@butch.lmsc.lockheed.com> wrote:
-
- >SomeClass obj( argc, argv);
- >
- >int main( int argc, char **argv) {
- >
- > blah, blah, blah
- >
- >}
-
- The following is the only way I know of to accomplish what you want.
-
- SomeClass* pObject = 0;
-
- int main(int argc,char *argv[])
- {
- pObject = new SomeClass(argc,argv);
- }
-
- On some OS's you can call a function to get the arguments of the
- program. If that's available that would be an alternative. You'd
- then just provide a default constructor and have the constructor call
- the appropiate functions. NT for example uses GetCommandLine to
- retrieve the command line string.
-
- ===============================================
- DISCLAIMER: I may be a member of humanity,
- but I'm not a spokesman for humanity.
- davidb@datalytics.com
-
- [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
- [ Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm ]
- [ Moderation policy: http://www.connobj.com/cpp/guide.htm ]
- [ Comments? mailto:c++-request@netlab.cs.rpi.edu ]
-